<template>
  <div class="search">
    <AppDownload></AppDownload>
    <div class="search-content">
      <van-search
        placeholder="搜索演出关键字"
        shape="round"
        class="search-input"
      />
      <div class="cancel" @click="backHome">取消</div>
    </div>

    <div class="group">
      <div class="group-title">音乐风格</div>
      <div class="group-list">
        <div class="tag" v-for="(item, index) in option1" :key="index">
          {{ item }}
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import instance from "../request/api";
import AppDownload from "./appDownload";

export default {
  name: "Search",

  data() {
    return {
      option1: [],
    };
  },

  mounted() {},
  created() {
    this.getOption();
  },
  methods: {
    async getOption() {
      let { data } = await instance.get("/home.json");

      this.option1 = data.home[2].search;
    },
    backHome() {
      this.$router.go(-1);
    },
  },
  components: {
    AppDownload,
  },
};
</script>

<style lang="less" scoped>
.search {
  width: 100%;
  overflow: hidden;
  position: relative;

  .search-content {
    width: 100%;
    border-bottom: 0.5px #ebebeb solid;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .search-input {
      width: 85%;
    }
    .cancel {
      width: 15%;
      text-align: center;
      font-size: 17px;
    }
  }

  .group {
    width: 100%;
    padding: 0 22px;
    box-sizing: border-box;
    .group-title {
      width: 100%;
      font-size: 19px;
      padding: 22px 0;
      box-sizing: border-box;
    }
    .group-list {
      overflow: hidden;

      .tag {
        display: inline-block;
        background: #f8f8f8;
        border-radius: 13px;
        height: 27px;
        line-height: 27px;
        padding: 0 16px;
        font-size: 14px;
        color: #666;
        margin: 0 13px 13px 0;
        box-sizing: border-box;
      }
    }
  }
}
</style>